<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>点击改变</title>
	<style>
	#demo{
		height: 200px;
		width: 200px;
		background-color: pink;
		
	}

	</style>
	
</head>
<body>
	<div id="demo"></div>  <!-- 先给一个盒子 -->
	<button id="btn">改变宽度</button>
<script> 
		 // 获得一个叫demode 盒子
	var demo=document.getElementById("demo");
				// 获得按钮;
	var btn =document.getElementById("btn")；
	btn.onclick = function(){
		demo.style.width="400px";
	}
</script>
	
</body>
</html>